package com.hyd.admin.resource.service.impl;

import java.math.BigDecimal;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.hyd.admin.resource.domain.Resource;
import com.hyd.admin.resource.mapper.ResourceMapper;
import com.hyd.admin.resource.service.IResourceService;
@Service
public class ResourceServiceImpl implements IResourceService {
	@Autowired
	ResourceMapper resourceMapper;
	@Override
	public List<Resource> selectResourceList(Resource resource) {
		return resourceMapper.selectResourceList(resource);
	}
	@Override
	public List<Resource> selectResourceListByUser(BigDecimal userId) {
		List<Resource> resourceList = resourceMapper.selectResourceListByUser(userId);
		return Resource.buildResourceTree(resourceList);
	}
}
